package app.modules.cloudpivot.aspect;

import java.util.LinkedHashSet;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 参与者函数切面
 *
 * @author LiuGangQiang Create in 2025/04/01
 */
//@Aspect
//@Component
public class ParticipantsAspect {
    private static final Logger LOG = LoggerFactory.getLogger(ParticipantsAspect.class);

    @Around("execution(java.util.LinkedHashSet<String> com.authine.cloudpivot.engine.service.runtime.ParticipleService.getParticipants(..))")
    public Object exectime(ProceedingJoinPoint point) throws Throwable {
        /* 执行目标方法并获取返回值 */
        Object result = point.proceed();
        if (result instanceof LinkedHashSet) {
            LOG.info("===>>这是参与者函数切面，最终返回的是用户ID集合：{}", result);
        }
        return result;
    }
}
